import {Component} from "react";
import "./index.less";
import Chat from '../chat/index'
import Card from '../card/index'
import Taro from '@tarojs/taro'
import Slide from 'react-reveal/Slide';
import {AtFloatLayout} from "taro-ui"

export default class Index extends Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
    Taro.eventCenter.on('changeModule', () => {
      this.changeShow()
    })
  }

  componentWillUnmount() {
  }

  componentDidShow() {
  }

  componentDidHide() {
  }

  state = {
    show: false
  }

  changeShow() {
    this.setState({
      show: !this.state.show
    })
  }


  render() {
    if (this.state.show)
      return (<Chat/>)
    return (<Card/>
  )

  }
}
